<%-- 
    Document   : login
    Created on : Mar 16, 2012, 10:54:10 AM
    Author     : lsf
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
    </head>
    <body>
   <%
            String username = request.getParameter("username");
            String password = request.getParameter("password");
           //out.println("Checking login<br>");
            if (username == null || password == null) {

                response.sendRedirect("index.jsp");
            }

            // Here you put the check on the username and password
            if (username.toLowerCase().trim().equals("admin") && password.toLowerCase().trim().equals("admin")) {
               
                session.setAttribute("username", username);
                response.sendRedirect("collection");
            }
           else 
               {
                //response.sendRedirect("index.jsp?msg=Invalid Username or Password");
                response.sendRedirect("index.jsp");
           }




%> 
    </body>
</html>
